//window.onload = function () {
	/* Example 1 */
	var overlay_1 = new OverlayJS({
		selector: "example_1",
		width: 300,
		height: 240,
		buttons: {
			"Close": function (button) {
				this.close();
			}
		}
	});
	document.getElementById("button_1").onclick = function () {
		overlay_1.open();
	};
	/* Example 2 */
	var overlay_2 = new OverlayJS({
		selector: "example_2",
		modal: true,
		width: 320,
		height: 140,
		buttons: {
			"Yes": function (button) {
				this.close();
			},
			"No": function (button) {
				this.close();
			}
		}
	});
	document.getElementById("button_2").onclick = function () {
		overlay_2.open();
	};
	/* Example 3 */
	var overlay_3 = new OverlayJS({
		selector: "example_3",
		modal: true,
		width: 320,
		height: 140,
		onClose: function () {
			var answer = this.getData("answer"),
				result = answer == 5 ? "That's correct" : "Incorrect";
			alert("Your answer is: " + answer + "\n" + result);
		},
		buttons: {
			"Four": function (button) {
				this.setData("answer", 4).close();
			},
			"Five": function (button) {
				this.setData("answer", 5).close();
			},
			"Six": function (button) {
				this.setData("answer", 6).close();
			},
			"Seven": function (button) {
				this.setData("answer", 7).close();
			}
		}
	});
	document.getElementById("button_3").onclick = function () {
		overlay_3.open();
	};
	/* Example 4 */
	var overlay_4 = new OverlayJS({
		selector: "example_4",
		modal: true,
		width: 240,
		height: 184,
		onBeforeOpen: function () {
			var that = this,
				img = new Image();
			img.onload = function () {
				that.content.innerHTML = "";
				that.content.appendChild(this);
			};
			img.src = "http://static.panoramio.com/photos/small/52367186.jpg";
		},
		header: false,
		footer: false,
		buttons: {}
	});
	document.getElementById("button_4").onclick = function () {
		overlay_4.open();
	};
//};